package webservice;

import org.apache.axis.client.*;

//import webservice.DBconfig;


import javax.xml.namespace.*;


import java.sql.ResultSet;
import java.net.*;

public class WebServiceClient {
	
	public WebServiceClient(String address) throws MalformedURLException {
		// TODO 4.2
	}
	
	public Object invoke(String operationName, Object[] params) throws Exception {
		// TODO 4.2
		
		return null; 
	}
	
	public static void main(String[] args) {
		try {
			URL endpoint = new URL("http://localhost:8080/axis/WebService.jws");
			Service service = new Service();
			
			// "echo" operation
			Call echoCall = (Call)service.createCall();	
			echoCall.setTargetEndpointAddress(endpoint);
			echoCall.setOperationName(new QName("test")); // operation name
			
			Object[] params = new Object[] {}; // operation parameters
			
			//System.out.println(echoCall.invoke(params));	// operation invocation
			
			System.out.println("------");
			System.out.println(echoCall.invoke(params));
			
			
			// TODO 4.3: instantiate WSClient
				
		} catch (Exception e) {
			e.printStackTrace();
			
		}
		
	}

}
